package com.qf.web;

import com.qf.bean.Dept;
import com.qf.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * IntelliJ IDEA -> person
 * 2019/11/20 20:27
 *
 * @author zmyao
 * 别看，我是渣渣。
 */
@Controller
public class DeptController  {
    @Autowired
    private DeptService deptService;

    @RequestMapping("/resource/demo2/getalldepts")
    public String getalldepts( ModelMap modelMap){
        List<Dept> depts = deptService.findalldepts();
        modelMap.addAttribute("depts",depts);
        return "resource/demo2/add";
    }

}
